/* 
 * ViaturaAction.java
 * 
 * Data de criação: 15/09/2010
 * 
 * CORPORATIVO - MTE. 
 *
 */
package br.com.o2solutions.siso.webapp.action;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Observer;

import br.com.o2solutions.core.service.Service;
import br.com.o2solutions.siso.integration.entidade.Viatura;
import br.com.o2solutions.siso.webapp.interceptor.ExceptionInterceptorAnnotation;

/**
 * Classe responsável por realizar a fronteira entre as operações de serviços
 * relacionadas ao Dominio {@link Viatura}.
 * 
 * @author Osvaldeir
 * @since 15/09/2010
 * 
 */
@Name("viaturaAction")
@ExceptionInterceptorAnnotation
public class ViaturaAction extends BaseAction<Viatura, Service<Viatura>> {

	private static final long serialVersionUID = -2798431110093230751L;

	@Override
	@In(value = "#{viaturaService}", scope = ScopeType.SESSION)
	public void setService(Service<Viatura> service) {
		super.setService(service);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * br.com.o2solutions.siso.webapp.action.BaseAction#loadEntityByLinkId()
	 */
	@Override
	public void loadEntityByLinkId() {
	}

	@Override
	@Observer({ "br.com.o2solutions.siso.webapp.action.ViaturaAction_SAVED",
			"br.com.o2solutions.siso.webapp.action.ViaturaAction_REMOVED",
			"br.com.o2solutions.siso.webapp.action.ViaturaAction_UPDATED" })
	public void updateResultList() {
		super.updateResultList();
	}
	
	@Override
	protected Viatura createNewEntity() {
		Viatura viatura =  super.createNewEntity();
		viatura.setAtiva(true);
		return viatura;
	}

}
